﻿@inherits Blazorise.ValidationError
@if ( ParentValidation?.Status == ValidationStatus.Error )
{
    <div @ref="@ElementRef" id="@ElementId" class="@ClassNames" style="@StyleNames" @attributes="@Attributes">
        <div class="ant-form-item-explain-error">
            @if ( ChildContent is not null )
            {
                @ChildContent
            }
            else if ( ErrorMessages is not null && ErrorMessages.Any() )
            {
                @if ( Multiline )
                {
                    <OrderedList Unstyled>
                        @foreach ( var errorMessage in ErrorMessages )
                        {
                            <OrderedListItem @key="@errorMessage">@errorMessage</OrderedListItem>
                        }
                    </OrderedList>
                }
                else
                {
                    @string.Join( ";", ErrorMessages )
                }
            }
        </div>
    </div>
}